package com.xuecheng.learning.convert;

import com.xuecheng.api.learning.model.dto.CourseRecordDTO;
import com.xuecheng.api.learning.model.dto.UserDTO;
import com.xuecheng.learning.entity.CourseRecord;
import com.xuecheng.learning.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created on 2021/04/15/17:59 周四
 *
 * @author Lantin
 */
@Mapper
public interface UserConvert {

    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);


    @Mapping(source = "id", target = "userId")
    UserDTO entity2dto(User user);

    List<UserDTO> entitys2dtos(List<User> list);
}
